package com.zjuee.service.auth.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.zjuee.base.valid.Insert;
import com.zjuee.base.valid.Update;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author wu liang
 * @since 1.0
 */
@Data
public class OrgVo implements Serializable {
    private static final long serialVersionUID = 1L;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @NotNull(message = "id can't be empty", groups = {Update.class})
    private Long id;

    /**
     * 父ID
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @NotNull(message = "id can't be empty", groups = {Insert.class})
    private Long parentId;

    /*组织机构名称*/
    @NotNull(message = "id can't be empty", groups = {Insert.class})
    private String orgName;

    /*组织机构类型*/
    private Byte orgType;

    /*业务外键，根据类型的不同，关联的表也不同*/
    @NotNull(message = "id can't be empty", groups = {Insert.class})
    private Long orgBusinessId;

    private String levelCode;

    /*所有子节点*/
    private List<OrgVo> children = new ArrayList<>();

}
